package com.frame.work.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.frame.work.entity.TblSecurityLog;
import com.frame.work.entity.TimeCount;
import com.frame.work.entity.dto.TimeCountDTO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * 告警信息数据层面逻辑
 *
 * @author wjming
 */
@DS("slave_1")
@Component
public interface TblSecurityLogMapper extends BaseMapper<TblSecurityLog> {

    /**
     * 查询设备告警信息
     *
     * @param pageNum
     * @param pageSize
     * @param gatewayMac
     * @param deviceMac
     * @param start
     * @param end
     * @return
     */
    List<TblSecurityLog> selectByTime(@Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize, @Param("gatewayMac") String gatewayMac, @Param("deviceMac") String deviceMac, @Param("start") String start, @Param("end") String end);

    /**
     * 查询当天的告警信息
     *
     * @param gatewayMac
     * @param deviceMac
     * @param start
     * @param end
     * @return
     */
    List<TblSecurityLog> selectByToday(@Param("gatewayMac") String gatewayMac, @Param("deviceMac") String deviceMac, @Param("start") String start, @Param("end") String end);

    /**
     * 查询每个报警事件段的数据数量
     *
     * @param gatewayMac
     * @param deviceMac
     * @param start
     * @param end
     * @return
     */
    List<TimeCount> selectTimeCount(@Param("gatewayMac") String gatewayMac, @Param("deviceMac") String deviceMac, @Param("start") String start, @Param("end") String end);

}
